/*
 * Copyright © 2021-now 尛飛俠（Denvie） All rights reserved.
 */

package cn.denvie.springboot.dds.controller;

import cn.denvie.springboot.dds.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户控制器。
 *
 * @author Denvie
 * @date 2022/3/28
 * @since 1.0.0
 */
@RestController
@RequestMapping("/user")
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dynamic-datasource")
public class DynamicDataSourceController {
    @Autowired
    private UserService userService;

    @RequestMapping("/query1")
    public Object query1() {
        return userService.query1();
    }

    @RequestMapping("/query2")
    public Object query2() {
        return userService.query2();
    }
}
